<%@page import="entity.DetailRoomE"%>
<%@page import="entity.User"%>
<%@page import="java.util.ArrayList"%>
<%@page import="entity.AppBorrowRoom"%>
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%  AppBorrowRoom abr = new AppBorrowRoom();
            ResultSet rs = abr.selectAll(1);

%>
<style type="text/css">
    <!--
    .tablel1  {
        width: 70px;
        border-top-width: 1px;
        border-bottom-width: 1px;
        border-left-width: 1px;
        border-top-style: none;
        border-bottom-style: none;
        border-left-style: none;
        border-top-color: #808080;
        border-right-color: #808080;
        border-bottom-color: #808080;
        border-left-color: #808080;
    }
    .tablel2 {
        width: 70px;
        border-top-width: 1px;
        border-bottom-width: 1px;
        border-top-style: none;
        border-bottom-style: none;
        border-right-width: 1px;
        border-right-style: none;
        border-top-color: #808080;
        border-right-color: #808080;
        border-bottom-color: #808080;
        border-left-color: #808080;
    }
    .tablec {
        width: 70px;
    }
    -->
</style>

<p>&nbsp;</p>
<hr />
<p>&nbsp;</p>
<table width="90%" border="1" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td width="32" align="center">STT</td>
        <td width="141" align="center">Họ và Tên</td>
        <td width="166" align="center">Đơn vị Phụ trách</td>
        <td width="130" align="center">Đơn Vị Mượn</td>
        <td align="center" class="tablec">Ngày</td>
        <td align="center" class="tablec">Phòng</td>
        <td align="center" class="tablec">Tiết</td>
        <td width="60">&nbsp;</td>
  </tr>
    <%while (rs.next()) {
                    String idDon = rs.getString("idDon");
                    AppBorrowRoom abr1 = new AppBorrowRoom();
                    abr1.setIdABR(idDon);
                    abr1.setHide("1");
                    boolean check = abr1.select();
                    if(check){

    %>


    <tr>
        <td> <%=idDon  %></td>
        <td align="left"><%= abr1.getUser().getName()%></td>
      <td align="left"><%= abr1.getUser().getTendvpt()%> </td>
      <td align="left"><%= abr1.getUser().getDvct()%> </td>




  <td colspan="3">
            <%for (int i = 0; i < abr1.getRooms().size(); i++) {%>
            <table width="100%" border="1" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="tablel1"><%=abr1.getRooms().get(i).getDate()%></td>
                    <td class="tablec"><%=abr1.getRooms().get(i).getRoomName()%> </td>
                    <td align="left" valign="top" class="tablel2"><%=abr1.getRooms().get(i).getPeriod()%></tr>
            </table>     <% }%>   </td>

        <td align="center"><form action="" method="post" name="form1" class="form1" id="form1">

                <input type="submit" name="chitiet" id="chitiet" value="Chi Tiết" />

            </form>
            <form action="" method="post" name="form1" class="form2" id="form2">
                <input type="submit" name="xóa" id="xóa" value="Xóa" />
            </form>
        </td>
  </tr>
    <%}}%>
</table>
<br />
<p>&nbsp;</p>
<hr />
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
